using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ModelTools._ModelOnly
{
    /// <summary>
    /// <para>If Selection Exists</para>
    /// <para>Evaluates if the input data has a selection and if a certain number of records are selected.</para>
    /// <para>评估输入数据是否具有选择，以及是否选择了一定数量的记录。</para>
    /// </summary>    
    [DisplayName("If Selection Exists")]
    public class SelectionExistsIfThenElse : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SelectionExistsIfThenElse()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_layer_or_view">
        /// <para>Layer Name or Table View</para>
        /// <para>Input layer or table view to evaluate.</para>
        /// <para>要评估的输入图层或表视图。</para>
        /// </param>
        /// <param name="_selection_condition">
        /// <para>Selection Condition</para>
        /// <para><xdoc>
        ///   <para>Specifies the selection condition to be used for the field values of the records matching the SQL expression.</para>
        ///   <bulletList>
        ///     <bullet_item>Exists—Checks whether the field value exists for the records matching the SQL expression. This is the default.</bullet_item><para/>
        ///     <bullet_item>No Selection—Checks whether none of the records matching the SQL expression are selected.</bullet_item><para/>
        ///     <bullet_item>All Selected—Checks whether all of the records matching the SQL expression are selected.</bullet_item><para/>
        ///     <bullet_item>Is Equal to—Checks whether the field value of the records matching the SQL expression is equal to the count value.</bullet_item><para/>
        ///     <bullet_item>Is Between—Checks whether the field value of the records matching the SQL expression is between the minimum count value and maximum count value.</bullet_item><para/>
        ///     <bullet_item>Is Less Than—Checks whether the field value of the records matching the SQL expression is equal to the count value.</bullet_item><para/>
        ///     <bullet_item>Is Greater Than—Checks whether the field value of the records matching the SQL expression is greater than the count value.</bullet_item><para/>
        ///     <bullet_item>Is Not Equal to—Checks whether the field value of the records matching the SQL expression is not equal to the count value.</bullet_item><para/>
        ///   </bulletList>
        ///   <para></para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要用于与 SQL 表达式匹配的记录的字段值的选择条件。</para>
        ///   <bulletList>
        ///     <bullet_item>存在 （Exists） - 检查与 SQL 表达式匹配的记录是否存在字段值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>无选择 （No Selection） - 检查是否未选择与 SQL 表达式匹配的记录。</bullet_item><para/>
        ///     <bullet_item>全部选定 （All Selected） - 检查是否选择了与 SQL 表达式匹配的所有记录。</bullet_item><para/>
        ///     <bullet_item>等于- 检查与 SQL 表达式匹配的记录的字段值是否等于计数值。</bullet_item><para/>
        ///     <bullet_item>介于两者之间 （Is Between） - 检查与 SQL 表达式匹配的记录的字段值是否介于最小计数值和最大计数值之间。</bullet_item><para/>
        ///     <bullet_item>小于（Is Less Than） - 检查与 SQL 表达式匹配的记录的字段值是否等于计数值。</bullet_item><para/>
        ///     <bullet_item>大于 - 检查与 SQL 表达式匹配的记录的字段值是否大于计数值。</bullet_item><para/>
        ///     <bullet_item>不等于 - 检查与 SQL 表达式匹配的记录的字段值是否不等于计数值。</bullet_item><para/>
        ///   </bulletList>
        ///   <para></para>
        /// </xdoc></para>
        /// </param>
        public SelectionExistsIfThenElse(object _in_layer_or_view, _selection_condition_value _selection_condition)
        {
            this._in_layer_or_view = _in_layer_or_view;
            this._selection_condition = _selection_condition;
        }
        public override string ToolboxName => "Model Tools";

        public override string ToolName => "If Selection Exists";

        public override string CallName => "mb.SelectionExistsIfThenElse";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_layer_or_view, _selection_condition.GetGPValue(), _count, _count_min, _count_max, _true, _false];

        /// <summary>
        /// <para>Layer Name or Table View</para>
        /// <para>Input layer or table view to evaluate.</para>
        /// <para>要评估的输入图层或表视图。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Layer Name or Table View")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_layer_or_view { get; set; }


        /// <summary>
        /// <para>Selection Condition</para>
        /// <para><xdoc>
        ///   <para>Specifies the selection condition to be used for the field values of the records matching the SQL expression.</para>
        ///   <bulletList>
        ///     <bullet_item>Exists—Checks whether the field value exists for the records matching the SQL expression. This is the default.</bullet_item><para/>
        ///     <bullet_item>No Selection—Checks whether none of the records matching the SQL expression are selected.</bullet_item><para/>
        ///     <bullet_item>All Selected—Checks whether all of the records matching the SQL expression are selected.</bullet_item><para/>
        ///     <bullet_item>Is Equal to—Checks whether the field value of the records matching the SQL expression is equal to the count value.</bullet_item><para/>
        ///     <bullet_item>Is Between—Checks whether the field value of the records matching the SQL expression is between the minimum count value and maximum count value.</bullet_item><para/>
        ///     <bullet_item>Is Less Than—Checks whether the field value of the records matching the SQL expression is equal to the count value.</bullet_item><para/>
        ///     <bullet_item>Is Greater Than—Checks whether the field value of the records matching the SQL expression is greater than the count value.</bullet_item><para/>
        ///     <bullet_item>Is Not Equal to—Checks whether the field value of the records matching the SQL expression is not equal to the count value.</bullet_item><para/>
        ///   </bulletList>
        ///   <para></para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要用于与 SQL 表达式匹配的记录的字段值的选择条件。</para>
        ///   <bulletList>
        ///     <bullet_item>存在 （Exists） - 检查与 SQL 表达式匹配的记录是否存在字段值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>无选择 （No Selection） - 检查是否未选择与 SQL 表达式匹配的记录。</bullet_item><para/>
        ///     <bullet_item>全部选定 （All Selected） - 检查是否选择了与 SQL 表达式匹配的所有记录。</bullet_item><para/>
        ///     <bullet_item>等于- 检查与 SQL 表达式匹配的记录的字段值是否等于计数值。</bullet_item><para/>
        ///     <bullet_item>介于两者之间 （Is Between） - 检查与 SQL 表达式匹配的记录的字段值是否介于最小计数值和最大计数值之间。</bullet_item><para/>
        ///     <bullet_item>小于（Is Less Than） - 检查与 SQL 表达式匹配的记录的字段值是否等于计数值。</bullet_item><para/>
        ///     <bullet_item>大于 - 检查与 SQL 表达式匹配的记录的字段值是否大于计数值。</bullet_item><para/>
        ///     <bullet_item>不等于 - 检查与 SQL 表达式匹配的记录的字段值是否不等于计数值。</bullet_item><para/>
        ///   </bulletList>
        ///   <para></para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Selection Condition")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _selection_condition_value _selection_condition { get; set; }

        public enum _selection_condition_value
        {
            /// <summary>
            /// <para>Exists</para>
            /// <para>Exists—Checks whether the field value exists for the records matching the SQL expression. This is the default.</para>
            /// <para>存在 （Exists） - 检查与 SQL 表达式匹配的记录是否存在字段值。这是默认设置。</para>
            /// </summary>
            [Description("Exists")]
            [GPEnumValue("EXISTS")]
            _EXISTS,

            /// <summary>
            /// <para>No Selection</para>
            /// <para>No Selection—Checks whether none of the records matching the SQL expression are selected.</para>
            /// <para>无选择 （No Selection） - 检查是否未选择与 SQL 表达式匹配的记录。</para>
            /// </summary>
            [Description("No Selection")]
            [GPEnumValue("NO_SELECTION")]
            _NO_SELECTION,

            /// <summary>
            /// <para>All Selected</para>
            /// <para>All Selected—Checks whether all of the records matching the SQL expression are selected.</para>
            /// <para>全部选定 （All Selected） - 检查是否选择了与 SQL 表达式匹配的所有记录。</para>
            /// </summary>
            [Description("All Selected")]
            [GPEnumValue("ALL_SELECTED")]
            _ALL_SELECTED,

            /// <summary>
            /// <para>Is Equal to</para>
            /// <para>Is Equal to—Checks whether the field value of the records matching the SQL expression is equal to the count value.</para>
            /// <para>等于- 检查与 SQL 表达式匹配的记录的字段值是否等于计数值。</para>
            /// </summary>
            [Description("Is Equal to")]
            [GPEnumValue("IS_EQUAL_TO")]
            _IS_EQUAL_TO,

            /// <summary>
            /// <para>Is Between</para>
            /// <para>Is Between—Checks whether the field value of the records matching the SQL expression is between the minimum count value and maximum count value.</para>
            /// <para>介于两者之间 （Is Between） - 检查与 SQL 表达式匹配的记录的字段值是否介于最小计数值和最大计数值之间。</para>
            /// </summary>
            [Description("Is Between")]
            [GPEnumValue("IS_BETWEEN")]
            _IS_BETWEEN,

            /// <summary>
            /// <para>Is Less Than</para>
            /// <para>Is Less Than—Checks whether the field value of the records matching the SQL expression is equal to the count value.</para>
            /// <para>小于（Is Less Than） - 检查与 SQL 表达式匹配的记录的字段值是否等于计数值。</para>
            /// </summary>
            [Description("Is Less Than")]
            [GPEnumValue("IS_LESS_THAN")]
            _IS_LESS_THAN,

            /// <summary>
            /// <para>Is Greater Than</para>
            /// <para>Is Greater Than—Checks whether the field value of the records matching the SQL expression is greater than the count value.</para>
            /// <para>大于 - 检查与 SQL 表达式匹配的记录的字段值是否大于计数值。</para>
            /// </summary>
            [Description("Is Greater Than")]
            [GPEnumValue("IS_GREATER_THAN")]
            _IS_GREATER_THAN,

            /// <summary>
            /// <para>Is Not Equal to</para>
            /// <para>Is Not Equal to—Checks whether the field value of the records matching the SQL expression is not equal to the count value.</para>
            /// <para>不等于 - 检查与 SQL 表达式匹配的记录的字段值是否不等于计数值。</para>
            /// </summary>
            [Description("Is Not Equal to")]
            [GPEnumValue("IS_NOT_EQUAL_TO")]
            _IS_NOT_EQUAL_TO,

        }

        /// <summary>
        /// <para>Count</para>
        /// <para>The integer count value.</para>
        /// <para>整数计数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Count")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _count { get; set; } = 0;


        /// <summary>
        /// <para>Minimum Count</para>
        /// <para>The minimum integer count value.</para>
        /// <para>最小整数计数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Count")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _count_min { get; set; } = 0;


        /// <summary>
        /// <para>Maximum Count</para>
        /// <para>The maximum integer count value.</para>
        /// <para>最大整数计数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Count")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _count_max { get; set; } = 0;


        /// <summary>
        /// <para>True</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("True")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _true { get; set; }


        /// <summary>
        /// <para>False</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("False")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _false { get; set; }


        public SelectionExistsIfThenElse SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}